package bancosys.tec.persist.base.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.base.domain.DummyFatSpanBean;
import bancosys.tec.persist.dao.BeanNotFoundException;
import bancosys.tec.persist.exception.PersistenceException;
import bancosys.tec.persist.span.fat.FatSpanAwareDAO;

public class DummyFatSpanBeanDAO extends FatSpanAwareDAO<DummyFatSpanBean> {

    public DummyFatSpanBean findVigenciaDummyByNome(String nome) throws PersistenceException, BeanNotFoundException {
        Criteria crit = this.getSession().createCriteria(this.getPersistableClass());
        crit.add(Restrictions.eq("nome", nome));
        return this.executeSingleQuery(crit);
    }
}
